<h1>{$gallery}</h1>
<table>
    <tr>
        {section name=photo loop=$photos}
        <td>
            <a href="{simage src=$photos[$smarty.section.photo.index] width=640 height=480 border=false}" rel="lightbox[gallery]">
                <img src="{simage src=$photos[$smarty.section.photo.index] width=88 height=68 border=true}" alt="{$gallery}" />
            </a>
        </td>
        {if $smarty.section.photo.index % 6 == 5}
    </tr>
    <tr>
        {/if}
        {/section}
    </tr>
</table>